#include "SpriteDef.h"

namespace LightPlayer{

	SPRITE_DEFINITION::SPRITE_DEFINITION(){
		init();
	}

	void SPRITE_DEFINITION::init(){
		m_CharacterId = 0;
		m_FrameCount = 0;
		m_ControlTags.init();
	}

	void SPRITE_DEFINITION::readFromStream( Stream* stream, const TAG& actual_tag ){
		init();
		//m_CharacterId = stream->read_u16();
		m_FrameCount = stream->read_u16();

		int size_of_control_tags = actual_tag.size - 4; // remove 4 byte (u16 CharacterId + u16 frameCount ) 
		m_ControlTags.init( stream->getCurrentPosition(), size_of_control_tags );
		stream->skip_byte( size_of_control_tags );
	}

};